From 4fe976549eef7b1986def03b31e78bb556f6cddb Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 23 Jan 2022 09:09:57 -0500 Subject: [PATCH] Use pango api better Avoid direct access to PangoLayoutLine members, use pango api for it where we can. --- gtk/gtklabel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 5def4168b6..7560e551fe 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -899,8 +899,8 @@ get_cursor_direction (GtkLabel *self) * definitely in this paragraph, which is good enough * to figure out the resolved direction. */ - if (line->start_index + line->length >= self->select_info->selection_end) - return line->resolved_dir; + if (pango_layout_line_get_start_index (line) + pango_layout_line_get_length (line) >= self->select_info->selection_end) + return pango_layout_line_get_resolved_direction (line); } return PANGO_DIRECTION_LTR; -- 2.30.2